package coins;

//~--- non-JDK imports --------------------------------------------------------

import com.dukascopy.api.ITick;

//~--- JDK imports ------------------------------------------------------------

import java.util.Date;

public class Tick implements ITick {
    private double ask;
    private double askVolume;
    private double bid;
    private double bidVolume;
    private long   time;

    public Tick(long time, double ask, double bid, double askVolume, double bidVolume) {
        this.time      = time;
        this.ask       = ask;
        this.bid       = bid;
        this.askVolume = askVolume;
        this.bidVolume = bidVolume;
    }

    @Override
    public double getAsk() {
        return ask;
    }

    @Override
    public double getAskVolume() {
        return askVolume;
    }

    @Override
    public double[] getAskVolumes() {
        throw new RuntimeException("Not implemented");
    }

    @Override
    public double[] getAsks() {
        throw new RuntimeException("Not implemented");
    }

    @Override
    public double getBid() {
        return bid;
    }

    @Override
    public double getBidVolume() {
        return bidVolume;
    }

    @Override
    public double[] getBidVolumes() {
        throw new RuntimeException("Not implemented");
    }

    @Override
    public double[] getBids() {
        throw new RuntimeException("Not implemented");
    }

    @Override
    public long getTime() {
        return time;
    }

    @Override
    public double getTotalAskVolume() {

        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public double getTotalBidVolume() {

        // TODO Auto-generated method stub
        return 0;
    }

    public String toString() {
        return (new Date(time)).toGMTString() + "," + ask + "," + bid + "," + askVolume + "," + bidVolume;
    }
}


//~ Formatted by Jindent --- http://www.jindent.com
